﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FeesSchedule.ascx.cs" Inherits="PayrollHR.Administration.Modules.FeesScheduleControl" %>

<%@ Register Src="ToolTipLabelControl.ascx" TagName="ToolTipLabelControl" TagPrefix="uc1" %>

<%@ Register Src="DecimalTextBox.ascx" TagName="DecimalTextBox" TagPrefix="uc2" %>

<%@ Register Src="DatePicker.ascx" TagName="DatePicker" TagPrefix="uc3" %>
<asp:GridView ID="gvFeesSchedule" CssClass="HeaderStyle" runat="server"
    AutoGenerateColumns="False" Width="100%" ShowFooter="True" OnRowDeleting="gvFeesSchedule_RowDeleting" OnRowDataBound="gvFeesSchedule_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="Loại phí">
            <ItemTemplate>
                <asp:Label ID="lblFullProductName" runat="server" Text='<%# Eval("FessName") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="USD">
            <FooterTemplate>
                <asp:Label ID="lblTotal" runat="server" Text="Total" Font-Size="X-Large" ForeColor="#FF0066"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("CoursName").ToString())%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="USD">
            <FooterTemplate>
                <asp:Label ID="lblUSD" runat="server" Font-Bold="True"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="lblTemplateUSD" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="VND">
            <FooterTemplate>
                <asp:Label ID="lblVND" runat="server" Font-Bold="True"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="lblTemplateVND" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="USD">
            <FooterTemplate>
                <asp:Label ID="lblPayUSD" runat="server" Font-Bold="True"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="lblTemplateHaveToPayUSD" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="VND">
            <FooterTemplate>
                <asp:Label ID="lblPayVND" runat="server" Font-Bold="True"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="lblTemplateHaveToPayVND" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Ngày nộp">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("DateSubmitted").ToString())%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="USD">
            <FooterTemplate>
                <asp:Label ID="lblBalanceUSD" runat="server" Text=""></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="txtBalanceUSD" runat="server" Text='<%# Convert.ToInt32(Eval("AmountUSD")) - Convert.ToDouble(Eval("HaveToPayUSD"))%>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="VND">
            <FooterTemplate>
                <asp:Label ID="lblBalanceVND" runat="server" Text=""></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="txtBalanceVND" runat="server" Text='<%# Convert.ToInt32(Eval("AmountVND")) - Convert.ToDouble(Eval("HaveToPayVND"))%>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Sửa" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:HiddenField ID="hfFeesScheduleID" runat="server" Value='<%# Eval("FeesScheduleID") %>' />
                <asp:LinkButton ID="lbDelete" runat="server" CommandName="Delete" Text="Delete" />
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
            <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
        </asp:TemplateField>

    </Columns>
</asp:GridView>
<style type="text/css">
    .HeaderStyle
    {
        /*background-color: #C94047;*/
        /*background: url('/App_Themes/administration/images/nav_bg.gif') repeat-x 50%;*/
        font-weight: bold;
        text-align: center;
        color: #fff;
        padding: 5px 10px 5px 10px;
        vertical-align: middle;
        font-weight: bold;
        border: solid 1px #676767;
    }
</style>
<p></p>
<asp:HiddenField ID="hfCustomerId" runat="server" />
<asp:Panel runat="server" ID="pnlError" EnableViewState="false" Visible="false" class="messageBox messageBoxError">
    <asp:Literal runat="server" ID="lErrorTitle" EnableViewState="false" />
</asp:Panel>
<table class="auto-style1" border="1">
    <tr>
        <td rowspan="2" style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblFeesTypeID" Text="<% $PayrollResources:Admin.FeesSchedule.FeesTypeID.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.FeesTypeID.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td rowspan="2" style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblCourses" Text="<% $PayrollResources:Admin.FeesSchedule.Courses.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Courses.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td colspan="2" style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblAmount" Text="<% $PayrollResources:Admin.FeesSchedule.Amount.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Amount.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td colspan="2" style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblHaveToPay" Text="<% $PayrollResources:Admin.FeesSchedule.HaveToPay.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.HaveToPay.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td rowspan="2" style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblDate" Text="<% $PayrollResources:Admin.FeesSchedule.Date.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Date.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center" colspan="2">
            <uc1:ToolTipLabelControl runat="server" ID="lblBalance" Text="<% $PayrollResources:Admin.FeesSchedule.Balance.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Balance.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
    </tr>
    <tr>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblAmountUSD" Text="<% $PayrollResources:Admin.FeesSchedule.AmountUSD.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.AmountUSD.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblAmountVND" Text="<% $PayrollResources:Admin.FeesSchedule.AmountVND.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.AmountVND.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblHaveToPayUSD" Text="<% $PayrollResources:Admin.FeesSchedule.HaveToPayUSD.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.HaveToPayUSD.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblHaveToPayVND" Text="<% $PayrollResources:Admin.FeesSchedule.HaveToPayVND.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.HaveToPayVND.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblBalanceUSD" Text="<% $PayrollResources:Admin.FeesSchedule.BalanceUSD.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.BalanceUSD.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblBalanceVND" Text="<% $PayrollResources:Admin.FeesSchedule.BalanceVND.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.BalanceVND.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
    </tr>
    <tr>
        <td style="text-align: center">
            <asp:DropDownList ID="ddlFeesTypeID" runat="server" Style="text-align: center">
            </asp:DropDownList>
        </td>
        <td style="text-align: center">
            <asp:DropDownList ID="dllCourses" runat="server" Style="text-align: center">
            </asp:DropDownList>
        </td>
        <td class="auto-style1">
            <uc2:DecimalTextBox ID="txtAmountUSD" runat="server" Width="100px" />
        </td>
        <td>
            <uc2:DecimalTextBox ID="txtAmountVND" runat="server" Width="100px" />
        </td>
        <td>
            <uc2:DecimalTextBox ID="txtHaveToPayUSD" runat="server" Width="100px" />
        </td>
        <td>
            <uc2:DecimalTextBox ID="txtHaveToPayVND" runat="server" Width="100px" />
        </td>
        <td>

            <uc3:DatePicker ID="dpDate" runat="server" />
        </td>
        <td>
            <uc2:DecimalTextBox ID="txtBalance" runat="server" Width="100px" />
        </td>
        <td>
            <uc2:DecimalTextBox ID="txtVND" runat="server" Width="100px" />
        </td>
    </tr>
    <tr>
        <td style="text-align: center">
            <uc1:ToolTipLabelControl runat="server" ID="lblTotal" Text="<% $PayrollResources:Admin.FeesSchedule.Total.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Total.Tooltip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td>&nbsp;</td>
        <td style="text-align: center">
            <asp:Label ID="lblTotalAmountUSD" runat="server"></asp:Label>
        </td>
        <td style="text-align: center">
            <asp:Label ID="lblTotalAmountVND" runat="server"></asp:Label>
        </td>
        <td style="text-align: center">
            <asp:Label ID="lblTotalHaveToPayUSD" runat="server"></asp:Label>
        </td>
        <td style="text-align: center">
            <asp:Label ID="lblTotalHaveToPayVND" runat="server"></asp:Label>
        </td>
        <td style="text-align: right">&nbsp;</td>
        <td>&nbsp;</td>
        <td style="text-align: right">
            <asp:Button ID="btnAdd" runat="server" CssClass="adminButtonBlue" OnClick="btnAddFeesSchedule_Click" Text="<% $PayrollResources:Admin.FeesSchedule.Add.Text %>"
                ToolTip="<% $PayrollResources:Admin.FeesSchedule.Add.Tooltip %>" CausesValidation="False" />
        </td>
    </tr>
</table>
